package ma.controller.panels.parameterpanels;

import ma.controller.panels.auxillary.CtrInformationPanel;
import ma.model.MWGDEInterface;
import ma.model.ManufacturingMethodInterface;
import ma.view.gui.parameterPanels.mwgde.GeoPanelDrilling;
import ma.view.gui.parameterPanels.mwgde.GeoPanelMilling;
import ma.view.gui.parameterPanels.mwgde.GeoPanelTurning;
/**
 * This controller class is especially for manufacturing methods of type
 * machining with geometrically defined edges.
 * @author Oliver Eckstein
 *
 */
public class CtrGeoPanelMWGDE extends
        CtrGeoPanel {

    
    public CtrGeoPanelMWGDE(
            ManufacturingMethodInterface manuMethod,
            CtrInformationPanel infoPanelCtr) {
        super(manuMethod, infoPanelCtr);        
    }

    @Override
    /*
     * (non-Javadoc)
     * @see ma.controller.panels2.parameterpanels.CtrParameterPanel#createView()
     */
    protected void createView() {
        MWGDEInterface manuMethod = (MWGDEInterface) this.manuMethod;
        switch(manuMethod.getSubType()) {
        case TURNING:
            panel = new GeoPanelTurning(
                    manuMethod.getSetCount(),
                    manuMethod.getName(), manuMethod,
                    infoPanelCtr,
                    this);
            break;
        case DRILLING:
            panel = new GeoPanelDrilling(
                    manuMethod.getSetCount(),
                    manuMethod.getName(), manuMethod,
                    infoPanelCtr,
                    this);
            break;
        case MILLING:
            panel = new GeoPanelMilling(
                    manuMethod.getSetCount(),
                    manuMethod.getName(), manuMethod,
                    infoPanelCtr,
                    this);
            break;
        default:
            break;
        }        
    }

}
